package com.ddpt;

import com.springboot.starter.coderacademy.base.CoderAcademyService;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.annotation.Resource;

@EnableDubbo
@EnableDiscoveryClient
@SpringBootApplication
@EnableAsync
@EnableScheduling
@MapperScan({"com.ddpt.mapper", "com.ddpt.**.mapper", "com.lh.**.core.**.dao", "com.lh.unimall.payment.dao"})
public class UserApplication {
    static CoderAcademyService coderAcademyService;

    @Resource
    public void setCoderAcademyService(CoderAcademyService coderAcademyService) {
        UserApplication.coderAcademyService = coderAcademyService;
    }

    public static void main(String[] args) {
        SpringApplication.run(UserApplication.class, args);
        System.out.println("【User】服务启动完成");
        testCoderAcademy();
    }

    public static void testCoderAcademy() {
        System.out.println(coderAcademyService.sayHello());
    }

}
